package com.wangtianxiang.sxp.po;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

@ApiModel(description = "活动")
@Data
@Accessors(chain = true)
@TableName(value = "tb_activity")
public class Activity extends BaseInfo {
    @ApiModelProperty(value = "活动id")
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    @ApiModelProperty(value = "活动类型id")
    @NotBlank(message = "活动类型id不能为空")
    private String activityTypeId;

    @ApiModelProperty(value = "活动标题")
    @NotBlank(message = "活动标题不能为空")
    private String activityTitle;

    @ApiModelProperty(value = "活动内容")
    @NotBlank(message = "活动内容不能为空")
    private String activityContent;

    @ApiModelProperty(value = "活动地址")
    @NotBlank(message = "活动地址不能为空")
    private String activityAddress;

    @ApiModelProperty(value = "活动开始时间")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "活动开始时间不能为空")
    private Date activityStartDate;

    @ApiModelProperty(value = "活动结束时间")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "活动结束时间不能为空")
    private Date activityEndDate;

    @ApiModelProperty(value = "活动发起人id")
    private String activityUserId;

    @ApiModelProperty(value = "活动发起人名称")
    private String activityUserName;

    @ApiModelProperty(value = "活动发起人联系方式")
    private String activityContact;


    private static final long serialVersionUID = 1L;
}
